#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    void moveZeroes(vector<int>& nums) 
    {
        for (size_t i = 0, j = -1; i < nums.size(); i++)
        {
            if (nums[i] != 0)
            {
                swap(nums[i], nums[++j]);
            }
        }
    }

};
int main()
{
    vector<int> s = { 13,14,0,456,0,3,6,45,0,0,0,43,14,6,56 };
    Solution a;
    a.moveZeroes(s);
    for (auto e : s)
    {
        cout << e << " ";
    }
	return 0;
}